package composite;


import composite.composemode.CakeHouseMenu;
import composite.composemode.DinerMenu;
import composite.composemode.Waitress;

/**
 * @description: 组合模式
 * 类之间有嵌套关系，可以使其彼此组合继承同一个超类
　* @author 周杨
　* @date 2019/5/29  18:22
**/
public class Main {
    public static void main(String[] args) {
        Waitress waitress = new Waitress();
        CakeHouseMenu cakeHouseMenu = new CakeHouseMenu();
        DinerMenu dinerMenu = new DinerMenu();
        waitress.addComponent(cakeHouseMenu);
        waitress.addComponent(dinerMenu);
        waitress.printVegetableMenu();
    }
}
